<?php

 
namespace RedMVC\Form\Element;

/**
 * Checkbox class
 *  
 * @category    RedMVC
 * @package     Form
 * @subpackage  Element 
 * @author      Jan Fischer, bitWorking <info@bitworking.de>
 */
class Checkbox extends AElement{    
    public function render(){
        $out        = '<input type="hidden" name="'.$this->varname.'" value="0" />';
        $checked    = ($this->getValue()=='1') ? ' checked="checked"' : '';
        $out        .= '<input type="checkbox" name="'.$this->varname.'" value="1"'.$checked.' />';
        return $out;
    }
}